package com.ruoyi.blog.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.blog.mapper.BizArticleLookMapper;
import com.ruoyi.blog.domain.BizArticleLook;
import com.ruoyi.blog.service.IBizArticleLookService;
import com.ruoyi.common.core.text.Convert;

/**
 * 访问记录Service业务层处理
 * 
 * @author wsa
 * @date 2019-10-20
 */
@Service
public class BizArticleLookServiceImpl implements IBizArticleLookService 
{
    @Autowired
    private BizArticleLookMapper bizArticleLookMapper;

    /**
     * 查询访问记录
     * 
     * @param id 访问记录ID
     * @return 访问记录
     */
    @Override
    public BizArticleLook selectBizArticleLookById(Long id)
    {
        return bizArticleLookMapper.selectBizArticleLookById(id);
    }

    /**
     * 查询访问记录列表
     * 
     * @param bizArticleLook 访问记录
     * @return 访问记录
     */
    @Override
    public List<BizArticleLook> selectBizArticleLookList(BizArticleLook bizArticleLook)
    {
        return bizArticleLookMapper.selectBizArticleLookList(bizArticleLook);
    }

    /**
     * 新增访问记录
     * 
     * @param bizArticleLook 访问记录
     * @return 结果
     */
    @Override
    public int insertBizArticleLook(BizArticleLook bizArticleLook)
    {
        bizArticleLook.setCreateTime(DateUtils.getNowDate());
        return bizArticleLookMapper.insertBizArticleLook(bizArticleLook);
    }

    /**
     * 修改访问记录
     * 
     * @param bizArticleLook 访问记录
     * @return 结果
     */
    @Override
    public int updateBizArticleLook(BizArticleLook bizArticleLook)
    {
        bizArticleLook.setUpdateTime(DateUtils.getNowDate());
        return bizArticleLookMapper.updateBizArticleLook(bizArticleLook);
    }

    /**
     * 删除访问记录对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBizArticleLookByIds(String ids)
    {
        return bizArticleLookMapper.deleteBizArticleLookByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除访问记录信息
     * 
     * @param id 访问记录ID
     * @return 结果
     */
    @Override
    public int deleteBizArticleLookById(Long id)
    {
        return bizArticleLookMapper.deleteBizArticleLookById(id);
    }
}
